using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TitanX;
using DG.Tweening;
using System;
public class DialogManger:MonoBehaviour{

    
    
    public Text contentText;
    public float chatSpeed;
  

    string[] chats=new string[]{"第一句话","第二句话","第三句话"};


    
    public void Start(){
        //contentText=transform.GetComponent<Text>();\

        talk(new string[] { "111", "2222" });

    }



    //NPC 头像
    public void NpcChat(){


        //出场动画    ----
        gameObject.transform.DOLocalMoveX(1.5f,0.5f).From(true);
        //执行talk


       

    }



    public void talk(string[] chats){

          Sequence quence = DOTween.Sequence();

        
        foreach(string chat in chats){

            //  
          Tweener tweener=  contentText.DOText(chat,6f);
            tweener.OnComplete(delegate
            {
                contentText.text = "";
            });
          quence.Append(tweener);

          //  contentText.text = "";

      //   quence.AppendInterval(1);

            //增加序列
        }

        quence.Play();
        //直接播放动画这一波





    }



}